/**
 * 
 */
package org.swing.utility.input.component;

import java.awt.Container;

import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JTextPane;

import org.swing.layout.other.PushBorderLayout;
import org.swing.layout.other.PushBorderLayout.Position;

/**
 * @author lqnhu
 *
 */
public class SwingComponent {
	
	/**
	 *set jpanel 
	 */
	public static void setPanel(Container container , Container subPanel , Position position) {
		container.add(subPanel , position);
	}
	
	/**
	 * set jlabel
	 */
	public static void setLabel( Container container ,JLabel label ,String text ) {
		label.setText(text);
		label.setName(text);
		container.add(label , PushBorderLayout.LINE_START);
	}
	
	/**
	 * set jtextfield
	 */
	public static void setTextField(Container container,JTextField textfield ,String text , int length) {
		textfield.setText(text);
		textfield.setName(text);
		textfield.setColumns(length);
		container.add(textfield , PushBorderLayout.LINE_START);
	}
	
	/**
	 * set jtextarea
	 */
	public static void createTextArea(Container container , JTextArea textArea ,String text , int length) {
		textArea.setText(text);
		textArea.setName(text);
		textArea.setColumns(length);
		container.add(textArea , PushBorderLayout.LINE_START);
	}
	
	/**
	 * set jtextpane
	 */
	public static void setTextPane(Container container , JTextPane textPane ,String text , int length) {
		textPane.setText(text);
		textPane.setName(text);
		container.add(textPane , PushBorderLayout.LINE_START);
	}
	
	
}
